using NUnit.Framework;

namespace ebcpatterns.wpf.tests
{
    [TestFixture]
    public class SynchronizerTests
    {
        [Test]
        public void Event_without_Parameter_is_propagated() {
            var sut = new Synchronizer();
            var count = 0;
            sut.Result += () => count++;

            sut.Process();

            Assert.That(count, Is.EqualTo(1));
        }

        [Test]
        public void Event_with_Parameter_is_propagated() {
            var sut = new Synchronizer<int>();
            var eventArg = 0;
            sut.Result += x => eventArg = x;

            sut.Process(42);

            Assert.That(eventArg, Is.EqualTo(42));
        }
    }
}